﻿using Newtonsoft.Json;

namespace Devonline.Http.AntDesign
{
    /// <summary>
    /// ant design response type
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class AntDesignResponse<T>
    {
        /// <summary>
        /// boolean; // if request is success
        /// </summary>
        [JsonProperty("success")]
        public bool Success { get; set; }
        /// <summary>
        /// any; // response data
        /// </summary>
        [JsonProperty("data")]
        public AntDesignData<T> Data { get; set; }
        /// <summary>
        /// string; // code for errorType
        /// </summary>
        [JsonProperty("errorCode")]
        public string ErrorCode { get; set; }
        /// <summary>
        /// string; // message display to user
        /// </summary>
        [JsonProperty("errorMessage")]
        public string ErrorMessage { get; set; }
        /// <summary>
        /// number; // error display type： 0 silent; 1 message.warn; 2 message.error; 4 notification; 9 page
        /// </summary>
        [JsonProperty("showType")]
        public ErrorDisplayType ShowType { get; set; }
        /// <summary>
        /// string; // Convenient for back-end Troubleshooting: unique request ID
        /// </summary>
        [JsonProperty("traceId")]
        public string TraceId { get; set; }
        /// <summary>
        /// string; // onvenient for backend Troubleshooting: host of current access server
        /// </summary>
        [JsonProperty("host")]
        public string Host { get; set; }
    }
}
